package wifiunion.com.notice;

import android.content.Context;

import java.util.HashMap;

/**
 * Created by Administrator on 2016/11/23.
 */

public class ConfigurePresenter implements ConfigureContact.Presenter, ConfigureContact.Callback {

    private ConfigureContact.View mView;
    private Context mContext;
    private ConfigureModel mModel;
    /**
     * 0
     * 1
     * 2
     * 3
     * 4
     * 5
     * 6
     */
    private int mType ;


    private HashMap<String,Object> param = new HashMap<>();


    public ConfigurePresenter(Context context, ConfigureContact.View view) {
        mView = view;
        mContext = context;
        mModel = new ConfigureModel();
        mView.setPresenter(this);
    }

    @Override
    public void onSuccess(Object data) {

        mView.onSuccess(data);
    }

    @Override
    public void onServerFailed(Object errorObj) {

        if(errorObj==null){

            mView.onError("");
        }
    }

    @Override
    public void onNetFailed() {

        mView.onError("网络异常");
    }

    @Override
    public void start() {
        HashMap<String, Object> params = new HashMap<String, Object>();
        mModel.loadData(Constants.HTTP_URL_GET_CONFIGURE, params, this);
    }

    @Override
    public void start(HashMap<String, Object> params) {
        mModel.loadData(Constants.HTTP_URL_GET_CONFIGURE, params, this);
    }
}
